package com.rede.didiok.admin.restapi;

import javax.annotation.Resource;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.rede.didiok.admin.service.AdminService;
import com.rede.didiok.admin.service.WebConfigService;
import com.rede.didiok.common.annotion.log.BussinessLog;
import com.rede.didiok.common.constant.conf.SysConf;
import com.rede.didiok.common.enums.BehaviorEnum;
import com.rede.didiok.common.feign.CommunityFeignClient;
import com.rede.didiok.common.feign.RankFeignClient;
import com.rede.didiok.common.feign.UserFeignClient;
import com.rede.didiok.common.utils.RedisUtil;
import com.rede.didiok.common.utils.ResultUtil;

/**
 * 关于我 RestApi
 *
 * @author Rede
 * @date 2023年11月12日14:51:54
 */
@RestController
@RequestMapping("/about/admin")
@Api(value = "关于我相关接口", tags = {"关于我相关接口"})
@Slf4j
public class UserCenterRestApi {

    @Resource
    private AdminService adminService;
    @Resource
    private WebConfigService webConfigService;
    @Resource
    private RankFeignClient rankFeignClient;
    @Resource
    private UserFeignClient userFeignClient;
    @Resource
    private CommunityFeignClient communityFeignClient;
    @Autowired
    private RedisUtil redisUtil;

    /**
     * 获取关于我的信息
     */
    @BussinessLog(value = "关于我", behavior = BehaviorEnum.VISIT_PAGE)
    @ApiOperation(value = "关于我", notes = "关于我")
    @GetMapping("/getMe")
    public String getMe() {

        log.info("获取关于我的信息");
        return ResultUtil.result(SysConf.SUCCESS, adminService.getAdminByUser(SysConf.ADMIN));
    }

    @ApiOperation(value = "获取联系方式", notes = "获取联系方式")
    @GetMapping("/getContact")
    public String getContact() {
        log.info("获取联系方式");
        return ResultUtil.result(SysConf.SUCCESS, webConfigService.getWebConfigByShowList());
    }

}

